package com.example.bbfindhouse.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import androidx.appcompat.app.AppCompatActivity;

import com.example.bbfindhouse.R;

public class wodeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.wode);

        // 找到用于点击跳转的视图
        LinearLayout followSubscribeLayout = findViewById(R.id.follow_subscribe_layout);
        LinearLayout browseViewingRecordLayout = findViewById(R.id.browse_viewing_record_layout);
        LinearLayout leaseEntrustLayout = findViewById(R.id.lease_entrust_layout);
        LinearLayout transactionWalletCouponLayout = findViewById(R.id.transaction_wallet_coupon_layout);

        // 为“我要出租”按钮添加点击事件监听器
        Button iWantToRentButton = findViewById(R.id.i_want_to_rent);
        iWantToRentButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到woyaochuzuActivity界面
                Intent intent = new Intent(wodeActivity.this, woyaochuzuActivity.class);
                startActivity(intent);
            }
        });

        // 为“我要卖房”按钮添加点击事件监听器
        Button iWantToSellButton = findViewById(R.id.i_want_to_sell);
        iWantToSellButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到woyaomaifangActivity界面
                Intent intent = new Intent(wodeActivity.this, woyaomaifangActivity.class);
                startActivity(intent);
            }
        });

        // 为关注和订阅布局添加点击事件监听器
        followSubscribeLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到guanzhu界面
                Intent intent = new Intent(wodeActivity.this, guanzhuActivity.class);
                startActivity(intent);
            }
        });

        // 为浏览看房记录布局添加点击事件监听器
        browseViewingRecordLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到liulanjilu界面
                Intent intent = new Intent(wodeActivity.this, liulanjiluActivity.class);
                startActivity(intent);
            }
        });

        // 为租约和委托布局添加点击事件监听器
        leaseEntrustLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到zuyue界面
                Intent intent = new Intent(wodeActivity.this, zuyueActivity.class);
                startActivity(intent);
            }
        });

        // 为交易钱包和优惠券布局添加点击事件监听器
        transactionWalletCouponLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到qianbao界面
                Intent intent = new Intent(wodeActivity.this, qianbaoActivity.class);
                startActivity(intent);
            }
        });

        // 为底部导航栏的首页布局添加点击事件监听器
        LinearLayout homeNavLayout = findViewById(R.id.home_nav_layout);
        homeNavLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到首页（IndexActivity）
                Intent intent = new Intent(wodeActivity.this, IndexActivity.class);
                startActivity(intent);
            }
        });

        // 为底部导航栏的消息布局添加点击事件监听器
        LinearLayout messageNavLayout = findViewById(R.id.message_nav_layout);
        messageNavLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到消息页（MessageActivity）
                Intent intent = new Intent(wodeActivity.this, MessageActivity.class);
                startActivity(intent);
            }
        });

        // 为底部导航栏的我的布局添加点击事件监听器
        LinearLayout mineNavLayout = findViewById(R.id.mine_nav_layout);
        mineNavLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到我的页面（wode）
                Intent intent = new Intent(wodeActivity.this, wodeActivity.class);
                startActivity(intent);
            }
        });
    }
}